﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCLD.Helpers.PaginatedList<MVCLD.Models.Article>>" %>
<%@ Import Namespace="MVCLD.Helpers" %>
<%@ Import Namespace="MVCLD.Settings" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=ViewData["CategoryName"]%> - <%= Settings.GeneralSiteName.ToString() %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% if (((IEnumerable<MVCLD.Models.Category>)ViewData["GetSubCategories"]).Count() > 0) { %>
		<div id="topcategories">
		<ul>
            <% foreach (var c in (IEnumerable<MVCLD.Models.Category>)ViewData["GetSubCategories"]) { %>
                <li><%=Html.ActionLink(c.CategoryName, "Index", "Category", new { UrlID = c.UrlID, catname = c.CategoryName.niceurl() }, null)%> </li>
            <% } %>
		</ul>
		<div class="clearer">&nbsp;</div>
		</div>
    <% }%>


	<div id="listingholder">
       <h1><%=ViewData["CategoryName"]%></h1>

       <% foreach (var item in Model) { %>
        <% Html.RenderPartial("articlelisttemaple", item); %>
        <% } %>
        

        <% if (Model.TotalPages > 0) { %>    
            <div class="pagination">
            <p>Page <%=Model.PageIndex + 1 %> of  <%=Model.TotalPages%> 
                <% if (Model.HasPreviousPage) { %>
                    <%= Html.RouteLink(Settings.CategoryPreviousButtonText, "category-browse", new { p = (Model.PageIndex - 1) })%>
                <% } %>
                
                <% if (Model.HasNextPage) { %>
                    <%= Html.RouteLink(Settings.CategoryNextButtonText, "category-browse", new { p=(Model.PageIndex + 1) })%>        
                <% } %></p>
            </div>    
        <% } %>
		
	</div>
</asp:Content>

